/* strlen 和 sizeof 对比使用示例 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
    char str[100] = "Linux application strlen test!";
    char *ptr = str;

    printf("sizeof str: %ld\n", sizeof(str));
    printf("strlen str: %ld\n", strlen(str));
    puts("~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    printf("sizeof ptr: %ld\n", sizeof(ptr));
    printf("strlen ptr: %ld\n", strlen(ptr));

    exit(0);
}